import * as Pinia from 'pinia';
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import * as modules from './modules/index.js'

const appStore = {}
export const registerStore = (app) => {
	const store = Pinia.createPinia()
	app.use(store)
  store.use(piniaPluginPersistedstate)
  for (const i in modules) {
    appStore[i] = modules[i]()
  }
	return Pinia
}
export default appStore

